<?php

namespace app\command;

use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;

class Crontab extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('crontab')
        ->addArgument('name', Argument::OPTIONAL, "Your Crontab name")
        ->setDescription('Set Your Crontab');

        
    }

    protected function execute(Input $input, Output $output)
    {
        $name = trim($input->getArgument('name'));
        switch($name){
            case 'translate':
                echo 'translate';
                break;
            case 'mail':
                echo 'mail';
                break;
            case 'ip':
                echo 'ip';
                break;
            case 'querylist'://爬虫任务
                echo 'querylist';
                break;
            default:
        }
    	// 指令输出
    	$output->writeln('finish');
    }
}
